using System.Collections.Generic;
using RentalOfCars.Domain.Entities;

namespace RentalOfCars.Server.Domain.Database
{
    public interface IDbAccessor
    {
        /// <summary>
        /// Connects to the database server.
        /// </summary>
        void Connect();

        /// <summary>
        /// Disconnects from the database server.
        /// </summary>
        void Disconnect();

        /// <summary>
        /// Returns user by login.
        /// </summary>
        /// <param name="login">Login.</param>
        /// <returns>User instance. Null if there is no such user.</returns>
        IEmployee GetEmployee(string login);

        /// <summary>
        /// Returns list of clients.
        /// </summary>
        /// <returns>Clients. Empty list if there are no clients.</returns>
        IList<IClient> GetClients();

        /// <summary>
        /// Returns list of available discounts.
        /// </summary>
        /// <returns>Discounts.</returns>
        IList<IDiscount> GetDiscounts();

        /// <summary>
        /// Adds client to the database.
        /// </summary>
        /// <param name="client">Client entity.</param>
        /// <returns>Returns new client entity with PersonId and ClientId.</returns>
        IClient AddClient(IClient client);

        /// <summary>
        /// Deletes client.
        /// </summary>
        /// <param name="clientId">Client's id.</param>
        void DeleteClient(int clientId);


        IList<IClient> GetRegularClients();
        IList<IClient> GetBestClients();
        IList<IClient> GetFineClients();
        IList<IEmployeeClass> GetEmployeeClasses();
        IEmployee AddEmployee(IEmployee employee);

        IList<ICar> GetCars();
        ICar AddCar(ICar car);
        void DeleteCar(int carId);

        IList<IBrand> GetBrands();
        IList<IFeature> GetFeatures();
        IList<IEmployee> GetEmployees();
        void FireEmployee(IEmployee employee);
    }
}